﻿@{
    var db = new Project_2._2.Models.QuanLyThueXeEntities();
    string layngay = DateTime.Now.ToString();
    DateTime ngayHT = Convert.ToDateTime(layngay);
    var adv_left = (from a in db.QuangCaos where a.ViTri == "Trái" select a).ToList();
    var adv_right = (from b in db.QuangCaos where b.ViTri == "Phải" select b).ToList();        
}

<div class="leftAdv">
    @foreach (var qc in adv_left)
    {
        if (qc.TrangThai == true)
        {
            <a href="@qc.LinkLienKet" target="_blank"><img src="~/Images/Adver/@qc.HinhAnh" /></a>
            break;
        }
        else
        {
            <img src="~/Images/Adver/lienhe.jpg" />
            break;
        }
    }
</div>

<div class="rightAdv">
    @foreach (var qc in adv_right)
    {
        if (qc.TrangThai == true)
        {
            <a href="@qc.LinkLienKet" target="_blank"><img src="~/Images/Adver/@qc.HinhAnh" /></a>   
            break;        
        }
        else
        {
            <img src="~/Images/Adver/lienhe.jpg" />
            break;
        }
    }
</div>